package com.qdxwx.models.enums;

import com.qdxwx.common.utils.TKRequest;

import jakarta.servlet.http.HttpServletRequest;

/**
 * 用户注册来源
 * @author developer
 */
public enum UserRegisterFrom {
    UNKNOWN,
    WEB,//注册用户
    WEIXIN,//微信
    MOBILE,//手机
    ADMIN,//后台开通用户
    THIRD;//第三方登陆用户

    public static String get(HttpServletRequest request) {
        if (TKRequest.isWxBrowse(request)) {
            return UserRegisterFrom.WEIXIN.toString();
        } else if (TKRequest.isMobileBrowse(request)) {
            return UserRegisterFrom.MOBILE.toString();
        } else {
            return UserRegisterFrom.WEB.toString();
        }
    }
}
